package com.cn.common;

public class BrokerEntity {

    private String address;
    private String name;
    private int broker_id;
    private String cluster_name;

    public void copyObject(BrokerEntity brokerEntity) {
        this.address = brokerEntity.getAddress();
    }

    @Override
    public int hashCode() {
        int prime = 31;
        int result = 1;
        result = prime * result + (address == null ? 0 : address.hashCode());
        result = prime * result + (name == null ? 0 : name.hashCode());
        result = prime * result + broker_id;
        result = prime * result + (cluster_name == null ? 0 : cluster_name.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        BrokerEntity other = (BrokerEntity) obj;
        if (getClass() != obj.getClass()) return false;
        if (address == null) {
            if (other.address != null) {
                return false;
            }
        } else if (!address.equals(other.address)) {
            return false;
        }

        if (name == null) {
            if (other.name != null) {
                return false;
            }
        } else if (!name.equals(other.name)) {
            return false;
        }
        if (cluster_name == null) {
            if (other.cluster_name != null) {
                return false;
            }
        } else if (!other.cluster_name.equals(cluster_name)) {
            return false;
        }
        if (broker_id != other.broker_id) {
            return false;
        }
        return true;
    }

    public BrokerEntity() {
    }

    public BrokerEntity(String address, String name) {
        this.address = address;
        this.name = name;
    }

    public BrokerEntity(String address) {
        this.address = address;
    }


    public String getAddress() {
        return address;
    }

    public BrokerEntity setAddress(String address) {
        this.address = address;
        return this;
    }

    public String getName() {
        return name;
    }

    public BrokerEntity setName(String name) {
        this.name = name;
        return this;
    }

    public int getBroker_id() {
        return broker_id;
    }

    public BrokerEntity setBroker_id(int broker_id) {
        this.broker_id = broker_id;
        return this;
    }

    public String getCluster_name() {
        return cluster_name;
    }

    public BrokerEntity setCluster_name(String cluster_name) {
        this.cluster_name = cluster_name;
        return this;
    }


}
